var leader = require("../../../../common/leader.js").leader;

Page({
    /**
   * 页面的初始数据
   */
    data: {
        myleaderinfo: {
            leader_id: -1,
            leader_shop: {
                is_leader_shop: 0
            }
        },
        lists: [ {
            type: 2,
            label: "发起群接龙-商家商品",
            icon: "icon-xinzeng"
        }, {
            type: 1,
            label: "发起群接龙-平台商品",
            icon: "icon-xinzeng"
        }, {
            type: 0,
            label: "复制已有群接龙",
            icon: "icon-fuzhi"
        } ]
    },
    /**
   * 生命周期函数--监听页面加载
   */
    onLoad(options) {},
    /**
   * 生命周期函数--监听页面初次渲染完成
   */
    onReady() {},
    /**
   * 生命周期函数--监听页面显示
   */
    onShow() {
        leader.getMyLeaderInfo_aync().then(() => {});
        //公用方法团长请求
        },
    /**
   * 生命周期函数--监听页面隐藏
   */
    onHide() {},
    /**
   * 生命周期函数--监听页面卸载
   */
    onUnload() {},
    jumpCreate: function(e) {
        let type = e.currentTarget.dataset.type;
        let url = "";
        wx.removeStorageSync("leaderCreate");
        //清除接龙创建内容缓存
                if (type >= 1) {
            //2023-05-13修改-去除未绑定自营店不可发起门店商品群接龙的判断
            // if(this.data.myleaderinfo.leader_shop.is_leader_shop != 1 && type == 2){ 
            //   wx.showModal({
            //     title: '提示',
            //     content: '暂未绑定自营店不可发起门店商品群接龙！',
            //     showCancel:false,
            //     complete: (res) => {}
            //   })
            //   return false
            // }
            url = `/leaderPerson/pages/groupDragon/Create/create?type=${type}`;
            wx.navigateTo({
                url: url
            });
        } else {
            url = "/leaderPerson/pages/groupDragon/PasteDragon/past-dragon";
            wx.navigateTo({
                url: url
            });
        }
    }
});